package com.harboursoftware.xstorage;

import com.harboursoftware.xstorage.results.ErrorResult;

/**
 * Base exception.
 * @author Simon Leung
 * @since 0.1
 */
public class XStorageException extends Exception {
    private static final long serialVersionUID = 1L;
    
    /**
     * 用于直接把ErrorResult直接传递到外层
     */
    private ErrorResult errorResult;

    public XStorageException() {
        super();
    }
    
    public XStorageException(ErrorResult errorResult, String message, Throwable cause) {
        super(message, cause);
        this.errorResult = errorResult;
    }
    
    public XStorageException(ErrorResult errorResult, String message) {
        super(message);
        this.errorResult = errorResult;
    }

    public XStorageException(String message, Throwable cause) {
        super(message, cause);
    }
    
    public XStorageException(ErrorResult errorResult) {
        this.errorResult = errorResult;
    }

    public XStorageException(String message) {
        super(message);
    }

    public XStorageException(Throwable cause) {
        super(cause);
    }

    public ErrorResult getErrorResult() {
        return errorResult;
    }

    public void setErrorResult(ErrorResult errorResult) {
        this.errorResult = errorResult;
    }
}
